home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2006 May
/
PCWMAY06.iso
/
Software
/
Freeware
/
First Page 2006 3.00
/
fp2006-final-3.00-setup.exe
/
{app}
/
Iscripts
/
Date & Calendars
/
first-day-of-the-week.izs
< prev
next >
Wrap
Text File
|
2005-09-27
|
3KB
|
139 lines
<!NOWIZARD>
<!TITLE>First Day of the Week
<!/TITLE>
<!DESCRIPTION>This script will return the dates of the beginning of each week in any given month.<!/DESCRIPTION>
<!CATEGORY>calenders<!/CATEGORY>
<!SCRIPT>
<!-- START OF SCRIPT -->
<!-- HOW TO INSTALL FIRST DAY OF THE WEEK:
1. Copy the coding into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the BODY of your HTML document -->
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function WeekStart(Month, Year, StartOfWeekDay) {
_Date = new Date(Year, Month, 1)
_LastDate = new Date()
_LastDate = new Date(_Date)
_LastDate.setMonth(_Date.getMonth() + 1)
_LastDate.setHours(_LastDate.getHours() - 24)
_Returns = new Array()
if (StartOfWeekDay == null) {
StartOfWeekDay = 0
}
var I = 1
while (I <= _LastDate.getDate()) {
_Date.setDate(I)
if (_Date.getDay() == StartOfWeekDay) {
_Returns[_Returns.length] = new Date(_Date)
I += 6
}
I++
}
return(_Returns)
}
// End -->
</script>
<FORM>
Month <SELECT NAME=Month>
<OPTION VALUE=0>Jan
<OPTION VALUE=1>Feb
<OPTION VALUE=2>Mar
<OPTION VALUE=3>Apr
<OPTION VALUE=4>May
<OPTION VALUE=5>Jun
<OPTION VALUE=6>Jul
<OPTION VALUE=7>Aug
<OPTION VALUE=8>Sep
<OPTION VALUE=9>Oct
<OPTION VALUE=10>Nov
<OPTION VALUE=11>Dec
</SELECT><BR>
Year <INPUT TYPE=TEXT NAME=Year SIZE=4 MAXLENGTH=4><BR>
<INPUT TYPE=BUTTON VALUE="Get Days" onClick="alert(WeekStart(document.forms[0].Month.value, document.forms[0].Year.value, 0))">
</FORM>
<!-- END OF SCRIPT -->
<!/SCRIPT>
<!PREVIEW>
<!-- START OF SCRIPT -->
<!-- HOW TO INSTALL FIRST DAY OF THE WEEK:
1. Copy the coding into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the BODY of your HTML document -->
<BODY>
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function WeekStart(Month, Year, StartOfWeekDay) {
_Date = new Date(Year, Month, 1)
_LastDate = new Date()
_LastDate = new Date(_Date)
_LastDate.setMonth(_Date.getMonth() + 1)
_LastDate.setHours(_LastDate.getHours() - 24)
_Returns = new Array()
if (StartOfWeekDay == null) {
StartOfWeekDay = 0
}
var I = 1
while (I <= _LastDate.getDate()) {
_Date.setDate(I)
if (_Date.getDay() == StartOfWeekDay) {
_Returns[_Returns.length] = new Date(_Date)
I += 6
}
I++
}
return(_Returns)
}
// End -->
</script>
<FORM>
Month <SELECT NAME=Month>
<OPTION VALUE=0>Jan
<OPTION VALUE=1>Feb
<OPTION VALUE=2>Mar
<OPTION VALUE=3>Apr
<OPTION VALUE=4>May
<OPTION VALUE=5>Jun
<OPTION VALUE=6>Jul
<OPTION VALUE=7>Aug
<OPTION VALUE=8>Sep
<OPTION VALUE=9>Oct
<OPTION VALUE=10>Nov
<OPTION VALUE=11>Dec
</SELECT><BR>
Year <INPUT TYPE=TEXT NAME=Year SIZE=4 MAXLENGTH=4><BR>
<INPUT TYPE=BUTTON VALUE="Get Days" onClick="alert(WeekStart(document.forms[0].Month.value, document.forms[0].Year.value, 0))">
</FORM>
<!-- END OF SCRIPT -->
<!/PREVIEW>
<!RELATED>NONE<!/RELATED>